<% if reply.reply_to && reply.reply_to&.user %>
  <%
  reply_to = reply.reply_to
  user = reply_to.user
  %>
  <div class="reply-to-block" data-reply-to-id="<%= reply_to.id %>">
    <div class="info">
      对
      <% if show_body %>
        <%= user_avatar_tag(user, :xs, reply: reply_to) %><%= user_name_tag(user, reply: reply_to) %>
      <% else %>
        <%= link_to reply_to_topic_reply_path(reply.topic, reply), remote: true do %>
          <%= user_avatar_tag(user, :xs, link: false, reply: reply_to) %><%= user_name_plain_span(user, reply: reply_to) %>
          <span class='reply-floor'></span>
        <% end %>
      <% end %>
      回复
    </div>

    <% if show_body %>
      <div class="markdown">
        <% if !reply.exposed_to_author_only? %>
          <% if !reply_to.exposed_to_author_only? || current_user == reply.topic.user || current_user == user %>
            <%= markdown(reply_to.body) %>
          <% else %>
            <i class="fa fa-lock"></i>
            <span class="author-only"><%= t("topics.exposed_to_author_only") %></span>
          <% end %>
        <% else %>
          <% if !reply_to.exposed_to_author_only? %>
            <%= markdown(reply_to.body) %>
          <% else %>
            <i class="fa fa-lock"></i>
            <span class="author-only"><%= t("topics.exposed_to_author_only") %></span>
          <% end %>
        <% end %>
      </div>
    <% end %>
  </div>
<% end %>
